package com.example.xm.adapter.HomeAdapter;

import android.content.Context;
import android.widget.ImageView;
import android.widget.TextView;

import com.bumptech.glide.Glide;
import com.example.xm.R;
import com.example.xm.base.BaseAdapter;
import com.example.xm.bean.HomeBean.HomeArticleRenShiBean;

import java.util.List;

public class Article_RenShiAdapter extends BaseAdapter {
    public Article_RenShiAdapter(Context context, List data) {
        super(context, data);
    }

    @Override
    protected int getLayout() {
        return R.layout.activity_renshi_item;
    }

    @Override
    protected void bindData(BaseViewHolder viewHolder, Object o) {

        ImageView img = (ImageView) viewHolder.getViewById(R.id.img_head_renshi);
        TextView tilte = (TextView) viewHolder.getViewById(R.id.tv_title_renshi);
        TextView text = (TextView) viewHolder.getViewById(R.id.tv_text_renshi);
        HomeArticleRenShiBean.DataBean bean = (HomeArticleRenShiBean.DataBean ) o;
        Glide.with(context).load(bean.getCover()).into(img);
        tilte.setText(bean.getTitle());
        text.setText(bean.getContentDescribe());
    }
}
